package day3.Exer;

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Exer1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
//        System.out.println("请输入一串字符");
//        StringBuilder str = new StringBuilder();
//        str.append(in.next());
//        for (int i = 0; i < str.length() ; i++) {
//            if (((int) str.charAt(i) >=48 && (int) str.charAt(i) <=57)) {
//                continue;
//            }
//            str = str.delete(i, i + 1);
//            i--;
//        }
//        System.out.println(str);
        System.out.println("请输入字符串：");
        String str = in.next();
        Pattern p = Pattern.compile("[^0-9]");
        Matcher m = p.matcher(str);
        System.out.println(m.replaceAll(""));
    }
}
